﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WSAP
{
    /// <summary>
    /// 显示参数
    /// </summary>
    public class StructrueChartParam
    {
        /// <summary>
        /// 是否显示变形后结构
        /// </summary>
        public bool IncludeDeformation { set; get; }

        /// <summary>
        /// 是否为模态窗口
        /// </summary>
        public bool isDialog { set; get; }

        /// <summary>
        /// 是否显示节点最大响应
        /// </summary>
        public bool isNodeMaxResponseShow { set; get; }

        /// <summary>
        /// 显示节点最大响应的自由度方向
        /// </summary>
        public int DOF { set; get; }

        /// <summary>
        /// 响应类型
        /// </summary>
        public NodeResponseEnum ResponseType { set; get; }

        /// <summary>
        /// 绘图类型
        /// </summary>
        public StructureChartType ChartType { set; get; }

        /// <summary>
        /// 动态绘图列表
        /// </summary>
        public List<double> DynamicDrawingList { set; get; }

        /// <summary>
        /// 获得对象
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public double this[int index]
        {
            get
            {
                if (this.DynamicDrawingList == null || 
                    index >= this.DynamicDrawingList.Count || 
                    index < 0)
                    return 1;
                return this.DynamicDrawingList[index];
            }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public StructrueChartParam()
        {
            this.IncludeDeformation = true;
            this.isDialog = true;
            this.isNodeMaxResponseShow = false;
            this.DOF = 1;
            this.ResponseType = NodeResponseEnum.Disp;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="chartType"></param>
        /// <param name="dynamicDrawingList"></param>
        public StructrueChartParam(StructureChartType chartType) : this()
        {
            //初始化
            this.DynamicDrawingList = new List<double>();
            //区分步数
            int stepNumber = 100;
            //确定Minus值
            int minus = chartType == StructureChartType.Eigen? -stepNumber / 2: 0;
            //添加至
            for (int i = 0; i <= 100; i++)
                this.DynamicDrawingList.Add(1.0 / stepNumber * (i + minus));
            this.ChartType = chartType;
        }
    }

    /// <summary>
    /// 楼板绘图
    /// </summary>
    public class SlabChartParam
    {
        /// <summary>
        /// 绘图类型
        /// </summary>
        public SlabChartEnum ChartEnum { set; get; }

        /// <summary>
        /// 应力角度
        /// </summary>
        public int Theta { set; get; }
    }


}
